package com.xdclass.userapp.config;

import org.apache.dubbo.config.MetadataReportConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author whg
 * @create 2023/7/17 10:54
 * @description：
 */
@Configuration
public class DubboConfig {

    @Value("${dubbo.registry.address}")
    private String zookeeperAddress;

    @Bean
    public MetadataReportConfig metadataReportConfig(){
        MetadataReportConfig metadataReportConfig = new MetadataReportConfig();
        metadataReportConfig.setAddress("zookeeper://" + zookeeperAddress);
        return metadataReportConfig;
    }
}
